package adminMenuHandler

import (
	exampleDtoApiPbAdminMenu "gitee.com/krio/ginc/example/dto/api/pb/admin/menu"
	adminMenuService "gitee.com/krio/ginc/example/internal/admin/menu/service"
	"github.com/gin-gonic/gin"
)

// AdminMenuList 列表
func AdminMenuList(ctx *gin.Context, req *exampleDtoApiPbAdminMenu.AdminMenuListReq) (*exampleDtoApiPbAdminMenu.AdminMenuListResp, error) {
	data, err := adminMenuService.AdminMenuList(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
}

// AdminMenuAdd 新增
func AdminMenuAdd(ctx *gin.Context, req *exampleDtoApiPbAdminMenu.AdminMenuInfo) (*exampleDtoApiPbAdminMenu.AdminMenuAddResp, error) {
	data, err := adminMenuService.AdminMenuAdd(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
}

// AdminMenuUpdate 修改
func AdminMenuUpdate(ctx *gin.Context, req *exampleDtoApiPbAdminMenu.AdminMenuInfo) (*exampleDtoApiPbAdminMenu.AdminMenuAddResp, error) {
	data, err := adminMenuService.AdminMenuUpdate(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
}

// AdminMenuDelete 删除
func AdminMenuDelete(ctx *gin.Context, req *exampleDtoApiPbAdminMenu.AdminMenuDeleteReq) (*exampleDtoApiPbAdminMenu.AdminMenuDeleteResp, error) {
	data, err := adminMenuService.AdminMenuDelete(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
}

// AdminMenuDetail 详情
func AdminMenuDetail(ctx *gin.Context, req *exampleDtoApiPbAdminMenu.AdminMenuDetailReq) (*exampleDtoApiPbAdminMenu.AdminMenuInfo, error) {
	data, err := adminMenuService.AdminMenuDetail(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
}
